import {httpDelete, httpGet, httpPageableGet, httpPost, httpPostWithQuery, httpPut} from '@/utils/request'


export async function findOne( id:any ){
  const {data, success} = await httpGet(`/api/v1/data-media-source/findOne/${id}` )
  return {data, success};
}

export async function list( params?:any ){
  const { data,total }  = await httpPageableGet('/api/v1/data-media-source/list',params)
  return { data,total };
}

export async function update( params?:any ){
  const { code }  = await httpPut('/api/v1/data-media-source/edit',params)
  return code === 200;
}

export async function create( params?:any ){
  const { code }  = await httpPost('/api/v1/data-media-source/add',params)
  return code === 200;
}

export async function check( params?:any ){
  const { data }  = await httpPost('/api/v1/data-media-source/check',params)
  return data;
}

export async function dataSourceCheck( params?:any ){
  const { data }  = await httpPostWithQuery('/api/v1/data-media-source/data-source-check',params)
  return data;
}

export async function deleteById( id:any ){
  const { code }  = await httpDelete(`/api/v1/data-media-source/delete/${id}` )
  return code === 200;
}

